#=
测试置换
=#


include("../src/pimary.jl")
using ..pimary

function run()
    fb = WrdFb(Float64, 3, 1)
    fb[1][1, :] = rand(3)
    fb[2][1, :] = rand(3) .+ 1
    fb[3][1, :] = rand(3) .+ 2
    println(fb)
    sgn, fb = sign_permute!(fb)
    println(sgn, " ", fb)
end


function run2()
    Np = 4
    fb = WrdFb(Float64, Np, 1)
    for i in 1:1:Np
        fb[i][1, :] = rand(3)
    end
    println(fb)
    #
    chkmat = zeros(Np, Np)
    rpos = beads(fb, 1)
    println(rpos)
    for i in Base.OneTo(Np); for j in Base.OneTo(Np)
        chkmat[i, j] = free_kinetic(rpos[[i], :], rpos[[j], :], [4.0, 4.0, 4.0])
    end; end
    println(chkmat)
    #
    chkmat2 = exch_free_kinetic(rpos, rpos, [4.0, 4.0, 4.0])
    println(chkmat2)
end


run()
run2()
